<%@ page language="java" pageEncoding="UTF-8"%>  
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>  
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>  
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ include file="../header.jsp"%>

<div class="content-wrapper" style="font-family: '微软雅黑';">
<input type="hidden" id="ctx" value="<%=request.getContextPath()%>"/>
  <!-- Content Header (Page header) -->
  <section class="content-header">
    <h1>
      ${module } <small>Control panel</small>
    </h1>
    <ol class="breadcrumb">
      <li><a href=""><i class="fa fa-dashboard"></i>主页</a></li>
      <li class="active">经纪人批量付款</li>
    </ol>
  </section>
  <!-- Main content -->
  <section class="content">
    <div class="row">
      <div class="col-xs-12">
        <div class="box">
          <div class="box-header">
          <div>  
    <div>
        创建开始时间： <input type="text" id="create_start_time"/>
        创建结束时间： <input type="text" id="create_end_time"/>
    <div>
        最迟付款开始时间： <input type="text" id="latest_start_time"/>
        最迟付款结束时间： <input type="text" id="latest_end_time"/>
    </div>
    </div>
    <div>
        状态： <select id="status">  
  <option value ="">请选择</option>  
  <option value ="0">待处理</option>  
  <option value="2">已处理</option>  
</select> 
        批次号： <input type="text" id="batchOrderNo"/>
        <input type="button" onclick="search1()"  value="查询">  
    </div>
    </div>  
          </div>
          <!-- /.box-header -->
          <div class="box-body">
<table id="example" class="display">
        <thead>
            <tr style="background-color: #97CBFF;color: white">
                  <th>批次号</th>
                  <th>提现总金额</th>
                  <th>提现总笔数</th>
                  <th>创建时间</th>
                  <th>最迟付款时间</th>
                  <th>状态</th>
                  <th>完成时间</th>
                 <!--  <th>回调ID</th> -->
                  <th>操作</th>
            </tr>
        </thead>
 
        <tbody>
			<tr>
				<td><div id="telephone"></div></td>
				<td><div id="withdrawType"></div></td>
				<td><div id="withdrawAccountNo"></div></td>
				<td><div id="withdrawAmount"></div></td>
				<td><div id="createTime"></div></td>
				<td><div id="status"></div></td>
				<td><div id="finishTime"></div></td>
				<td><div id="authTime"></div></td>
				
			</tr>
        </tbody>
    </table>
    </div>
          <!-- /.box-body -->
        </div>
        <!-- /.box -->
      </div>
      <!-- /.col -->
    </div>
    <!-- /.row -->
    <!--  显示下面的分页控件  -->
  </section>
  <!-- /.content -->
</div>
<jsp:include page="../js.jsp"/>
<%@ include file="../footer.jsp"%>
<script type="text/javascript">
$('#latest_start_time').datetimepicker({lang:'ch',timepicker:true});
$('#latest_end_time').datetimepicker({lang:'ch',timepicker:true});
$('#create_start_time').datetimepicker({lang:'ch',timepicker:true});
$('#create_end_time').datetimepicker({lang:'ch',timepicker:true});


var table;
$(document).ready(function() {
	table= $('#example').DataTable( {  
	        "pagingType": "simple_numbers",//设置分页控件的模式  
	         searching: false,//屏蔽datatales的查询框  
	         aLengthMenu:[10,50,100],//设置一页展示10条记录  
	         "bLengthChange": true,//屏蔽tables的一页展示多少条记录的下拉列表  
	         "oLanguage": {  //对表格国际化  
	            "sLengthMenu": "每页显示 _MENU_条",    
	            "sZeroRecords": "没有找到符合条件的数据",    
	        //  "sProcessing": "&lt;img src=’./loading.gif’ /&gt;",    
	            "sInfo": "当前第 _START_ - _END_ 条　共计 _TOTAL_ 条",    
	            "sInfoEmpty": "木有记录",    
	            "sInfoFiltered": "(从 _MAX_ 条记录中过滤)",    
	            "sSearch": "搜索：",    
	            "oPaginate": {    
	            "sFirst": "首页",    
	            "sPrevious": "前一页",    
	            "sNext": "后一页",    
	            "sLast": "尾页"    
	                   
	            }    
	        },  
	    "processing": true, //打开数据加载时的等待效果  
	        "serverSide": true,//打开后台分页  
	        "ajax": {  
	            "url":$('#ctx').val()+"/broker/batch/withdraw/list",   
	            "dataSrc": "aaData",   
	            "data": function ( d ) {  
	                var create_start_time = $('#create_start_time').val();  
	                var create_end_time = $('#create_end_time').val();  
	                var latest_start_time = $('#latest_start_time').val();  
	                var latest_end_time = $('#latest_end_time').val();  
	                var batchOrderNo = $('#batchOrderNo').val();  
	                var status = $('#status').val();  
	                //添加额外的参数传给服务器  
	                d.create_start_time = create_start_time;  
	                d.create_end_time = create_end_time;  
	                d.latest_start_time = latest_start_time;  
	                d.latest_end_time = latest_end_time;  
	                d.status = status;  
	                d.batchOrderNo = batchOrderNo;  
	            } 
	       
	        } ,  
	        "columns": [  
	            { "data": "batchOrderNo" },  
	            { "data": "batchFee" },  
	            { "data": "batchNum" },  
	            { "data": function(obj){
	            	return obj.createTime;
	            }},  
	            { "data": function(obj){
	            	return "<div>"+obj.latestTime+"</div>";
	            }},  
	            { "data": function(obj){
	                if(obj.status==0){
	                    return "待处理";
	                  }else if(obj.status==2){
	                    return "已处理";
	                  }else{
	                	  return "";
	                  }
	                } },  
	            { "data": "finishTime" },  
	            /* { "data": "notifyId" },  */
	            {"data":function(obj){
	            	if(obj.batchOrderNo!=null&&obj.batchOrderNo!=""&&obj.status==0){
	            	return "<a href='"+$("#ctx").val()+"/broker/broker/batch/withdraw/detail?batchOrderNo="+obj.batchOrderNo+"' >去付款</a>";
	            	}else{
	            		return "";
	            	}
	            }}
	        ]  
	      
	    } );  
	} );  
	
function search1()  
{  
	table.ajax.reload();  
} 

</script>





